<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <style>
        .hi{
            color:red
        }
        .hello{
            color:green
        }
        .success{
            color:green
        }
        .error{
            color:red
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="hi">你好</div>
        <div :class="myClass">我好</div>

        <button @click="update">修改</button>

        <div :class="{success:isok}">正确</div>
    </div>
</body>
<script>
    new  Vue({
        el:"#app",
        data:{
            myClass:"hi",
            isok:true
        },
        methods:{
            update(){
                this.myClass = "hello"
            }
        }
    })
</script>
</html>